package utils

import (
	"math"
	"strconv"
)

func CreateCode(len int8,index int) (int,error){
	max_config:=make(map[int8]int64)
	max_config[1]=7
	max_config[2]=97
	max_config[3]=997
	max_config[4]=9973
	max_config[6]=999983
	max_config[7]=9999991
	max_config[8]=99999989
	max_config[9]=999999937
	max_config[10]=9999999967
	max_config[11]=99999999977
	maxNumber:=max_config[len]
	seadNum,err:=strconv.Atoi(
		strconv.FormatFloat(
			math.Round(float64(maxNumber)/float64(3.4)),
			'f',
			0,
			64))
	return int(math.Mod(float64(seadNum*(index+seadNum)),float64(maxNumber))),err
}
